home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 September / 1987-09.d64 / speedsort demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  642b  |  17 lines

  1. 10 ifw=1then60
  2. 20 rem copyright 1987 compute! publications inc. - all rights reserved
  3. 30 poke53280,10:poke53281,10:print"[147][144]   copyright 1987 compute! pub., inc."
  4. 40 printtab(10)"all rights reserved"
  5. 50 w=1:load"speedsort",8,1
  6. 60 input"[147]how many random strings to create";n
  7. 70 dima$(n):print"[147]creating"n"random strings":a=rnd(-ti)
  8. 80 fori=1ton:printi;chr$(145):n1=int(rnd(1)*10+1):a$="":forj=1ton1
  9. 90 b$=chr$(int(rnd(1)*26+65)):a$=a$+b$:next:a$(i)=a$:next
  10. 100 print"press any key to start sort"
  11. 110 gets$:ifs$=""then110
  12. 120 t1=ti:sys49152,a$(0):t2=ti:print"[147]done"
  13. 130 mt$=str$((t2-t1)/60):print n"elements sorted in"left$(mt$,6)" seconds"
  14. 140 print"press any key for sorted list"
  15. 150 gets$:ifs$=""then150
  16. 160 fori=1ton:printa$(i):next
  17.